#version 450
layout(row_major) uniform;
layout(row_major) buffer;

#line 553 0
struct _MatrixStorage_float4x4_ColMajorstd140_0
{
    vec4  data_0[4];
};


#line 7 1
struct PointLight_std140_0
{
    vec4 position_0;
    vec4 color_0;
};


#line 7
struct _Array_std140_PointLight10_0
{
    PointLight_std140_0  data_1[10];
};




struct GlobalUbo_std140_0
{
    _MatrixStorage_float4x4_ColMajorstd140_0 projection_0;
    _MatrixStorage_float4x4_ColMajorstd140_0 view_0;
    _MatrixStorage_float4x4_ColMajorstd140_0 inverseView_0;
    vec4 ambientLightColor_0;
    _Array_std140_PointLight10_0 pointLights_0;
    int numLights_0;
};




layout(binding = 0)
layout(std140) uniform block_GlobalUbo_std140_0
{
    _MatrixStorage_float4x4_ColMajorstd140_0 projection_0;
    _MatrixStorage_float4x4_ColMajorstd140_0 view_0;
    _MatrixStorage_float4x4_ColMajorstd140_0 inverseView_0;
    vec4 ambientLightColor_0;
    _Array_std140_PointLight10_0 pointLights_0;
    int numLights_0;
}ubo_0;

#line 34
layout(binding = 1)
uniform sampler2D combinedSampler_0;


#line 962 0
layout(location = 0)
out vec4 entryPointParam_fsMain_0;


#line 962
layout(location = 0)
in vec3 fragColor_0;


#line 962
layout(location = 1)
in vec3 fragPosWorld_0;


#line 962
layout(location = 2)
in vec3 fragNormalWorld_0;


#line 962
layout(location = 3)
in vec2 fragUV_0;


#line 68 1
void main()
{

#line 74
    vec3 _S1 = ubo_0.ambientLightColor_0.xyz * ubo_0.ambientLightColor_0.w;
    const vec3 _S2 = vec3(0.0, 0.0, 0.0);

    vec3 _S3 = normalize(fragNormalWorld_0);

    vec3 _S4 = normalize(vec3(ubo_0.inverseView_0.data_0[0][3], ubo_0.inverseView_0.data_0[1][3], ubo_0.inverseView_0.data_0[2][3]) - fragPosWorld_0);

    int _S5 = min(ubo_0.numLights_0, 10);

#line 81
    int i_0 = 0;

#line 81
    vec3 specularLight_0 = _S2;

#line 81
    vec3 diffuseLight_0 = _S1;
    for(;;)
    {

#line 82
        if(i_0 < _S5)
        {
        }
        else
        {

#line 82
            break;
        }

#line 83
        vec3 lightDir_0 = ubo_0.pointLights_0.data_1[i_0].position_0.xyz - fragPosWorld_0;

        vec3 directionToLight_0 = normalize(lightDir_0);

        vec3 intensity_0 = ubo_0.pointLights_0.data_1[i_0].color_0.xyz * ubo_0.pointLights_0.data_1[i_0].color_0.w * (1.0 / dot(lightDir_0, lightDir_0));



        vec3 specularLight_1 = specularLight_0 + intensity_0 * pow(max(dot(_S3, normalize(directionToLight_0 + _S4)), 0.0), 512.0);


        vec3 diffuseLight_1 = diffuseLight_0 + intensity_0 * max(dot(_S3, directionToLight_0), 0.0);

#line 82
        i_0 = i_0 + 1;

#line 82
        specularLight_0 = specularLight_1;

#line 82
        diffuseLight_0 = diffuseLight_1;

#line 82
    }

#line 82
    entryPointParam_fsMain_0 = vec4((diffuseLight_0 + specularLight_0) * fragColor_0 * (texture((combinedSampler_0), (fragUV_0))).xyz, 1.0);

#line 82
    return;
}

